﻿using IM.Easy.Entity.System;
using IM.Easy.SystemServices.Dtos;
using Mapster;

namespace IM.Easy.SystemServices.Mapper;

public class UserMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        //登录用户映射
        config.ForType<SysUser, UserProfile>()
                .AfterMapping((src, dest) =>
                {
                    dest.RoleGroup = src.Roles.Select(s => s.Name).ToList();
                });

    }
}
